<extend name="Base:common" />
<block name="body">

<link rel="stylesheet" type="text/css" href="__CSS__/go/GoodsList.css"/>
<link rel="stylesheet" type="text/css" href="__CSS__/go/head.css"/>
<link rel="stylesheet" href="__CSS__/go/index3.css" />
<script>
function showh(){
var height=$("#ddBrandList_brand").innerHeight();	
	if(height==78){
		$("#ddBrandList_brand").css("height","auto");
		$(".list_classMore").addClass("MoreClick");
		$(".list_classMore").html("收起<i></i>");
	}else{
		$("#ddBrandList_brand").css("height","78px");
		$(".list_classMore").removeClass("MoreClick");
		$(".list_classMore").html("展开<i></i>");
	};
}
$(function(){	
	$(".list_classMore").click(showh);
});
</script>
<div class="wrap" id="loadingPicBlock">
	<!--排序-->
	<input type="hidden" id="msort" value="{$msort}"/>
	<!--升降-->
	<input type="hidden" id="sj" value="{$sj}"/>
	<div class="Current_nav"><a href="{:U('Home/Yungo/index')}">一元云购</a> &gt; <if condition="$c1Id neq 0">{$catName}<else />所有分类</if>
	<div class="m-other fr" id="btnMyCart"><a class="goCartList" href="{:U('Home/Yungo/index',array('to'=>1))}" title="云购清单"><em>云购清单</em><span>{$cartNum}</span></a></div>
	</div>
	
	<div class="box_shadow">
	<div id="current" class="list_Curtit">
		<h1 class="fl"><if condition="$c1Id neq 0">{$catName}<else />所有分类</if></h1>
		<span id="spTotalCount">(共<em class="orange">{$pages['total']}</em>件相关商品)</span>
	</div>	
	<div class="list_class">
	<dl>
		<dt>分类</dt>
		<dd id="ddBrandList">
			<ul>            
				<li><a href="javascript:;" onclick="queryGoGoods(this,1)" <if condition="$c1Id eq 0">class="ClassCur"</if> >全部</a></li>
				<volist name="goodsNav" id="vo">
                	<li><a href="javascript:;" onclick="queryGoGoods(this,1)" data="{$vo['catId']}" <if condition="$c1Id eq $vo['catId']">class="ClassCur"</if> >{$vo['catName']}</a></li>
                </volist>
			</ul>
		</dd>
	</dl>
	</div>	
	<div class="list_class">
	<dl>
		<dt>品牌</dt>
		<dd id="ddBrandList_brand" style="height:78px">
			<ul>
				<li><a href="javascript:;" onclick="queryGoGoods(this,2)" <if condition="$brandId eq 0">class="ClassCur"</if> >全部</a></li> 
				<volist name="brands" id="vo">
					<li><a href="javascript:;" onclick="queryGoGoods(this,2)" data="{$vo['brandId']}" <if condition="$brandId eq $vo['brandId']">class="ClassCur"</if>>{$vo['brandName']}</a></li>   
				</volist>
			</ul>
		</dd>
	</dl>

		
	<a class="list_classMore" href="javascript:;">展开<i></i></a>
		
	</div>
	    <div class="list_Sort">
		    <dl>
			    <dt>排序</dt>
			    <dd>
                <a href="javascript:;" onclick="queryGoGoods(this,3)" <if condition="$msort eq 3">class="SortCur"</if>>即将揭晓</a>
                <a href="javascript:;" onclick="queryGoGoods(this,4)" <if condition="$msort eq 4">class="SortCur"</if>>人气</a>
                <a href="javascript:;" onclick="queryGoGoods(this,5)" <if condition="$msort eq 5">class="SortCur"</if>>剩余人次</a>
                <a href="javascript:;" onclick="queryGoGoods(this,1)" <if condition="$msort eq 1">class="SortCur"</if>>最新</a>
                <a href="javascript:;" onclick="queryGoGoods(this,6)" 
                <if condition="$msort eq 6">class="Price_Sort SortCur"</if>
                <if condition="$msort eq 7">class="Price_Sort SortCur"</if>>价值<if condition="$msort eq 6"><s></s></if><if condition="$msort eq 7"><i></i></if></a>
                </dd>
		    </dl>
	    </div>
	
	</div>
	
		
	
	<!--商品列表-->
	<div class="listContent">
		<ul class="item" id="ulGoodsList">		
			<volist name="pages['root']" id="vo">
			<li class="goods-iten" >
				<div class="pic">
					<a href="{:U('Home/Yungo/index',array('to'=>4,'gid'=>$vo['id']))}" target="_blank" title="{$vo['title']}">							
                        <if condition="$vo['renqi'] eq 1"><i class="goods_rq"></i></if>                     	
						<img alt="{$vo['title']}" src="__ROOT__/{$vo['thumb']}">
					</a>
					<p name="buyCount" style="display:none;"></p>
				</div>
				<p class="name">
					<a href="{:U('Home/Yungo/index',array('to'=>4,'gid'=>$vo['id']))}" target="_blank" title="{$vo['title']}">{$vo['title']}</a>
				</p>
				<p class="money">价值：<span class="rmbgray">{$vo['money']}</span></p>
				<div class="Progress-bar">
					<p title="已完成{$vo['scale']}%"><span style="width:{$vo['scale']}%;"></span></p>
					<ul class="Pro-bar-li">
						<li class="P-bar01"><em>{$vo['canyurenshu']}</em>已参与人次</li>
						<li class="P-bar02"><em>{$vo['zongrenshu']}</em>总需人次</li>
						<li class="P-bar03"><em>{$vo['shenyurenshu']}</em>剩余人次</li>
					</ul>
				</div>
				<div class="gl_buybtn">
					<div class="go_buy">
						<a href="javascript:;" title="立即购买" class="go_Shopping fl nowget" goods_id="{$vo['id']}">立即云购</a>
						<a href="javascript:;" title="加入清单" class="go_cart fr oneget" goods_id="{$vo['id']}">加入清单</a>
					</div>
				</div>
				<div class="Curbor_id" style="display:none;">{$vo['id']}</div>
				<div class="Curbor_yunjiage" style="display:none;">{$vo['yunjiage']}</div>
				<div class="Curbor_shenyu" style="display:none;">{$vo['shenyurenshu']}</div>
			</li>
			</volist>
		</ul>
			<div class="wst-page" style="text-align:center;">
				<div id="wst-page-items"></div>
			</div>
			<div class="wst-clear"></div>
	<!--商品列表完-->
		
</div>
	<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
	<script src="__JS__/goods.js"></script>
	<script>
	<if condition="$bs eq 1">
		$("#wst-brand-tp").click();
	</if>
	<if condition="$pages['totalPage'] gt 1">
	
	laypage({
	    cont: 'wst-page-items',
	    pages: {$pages["totalPage"]}, //总页数
	    skip: true, //是否开启跳页
	    skin: '#e23e3d',
	    groups: 3, //连续显示分页数
	    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
	        var page = location.search.match(/pcurr=(\d+)/);
	        return page ? page[1] : 1;
	    }(), 
	    jump: function(e, first){ //触发分页后的回调
	        if(!first){ //一定要加此判断，否则初始时会无限刷新
	        	var nuewurl = WST.splitURL("pcurr");
	        	var ulist = nuewurl.split("?");
	        	if(ulist.length>1){
	        		location.href = nuewurl+'&pcurr='+e.curr;
	        	}else{
	        		location.href = '?pcurr='+e.curr;
	        	}
	            
	        }
	    }
	});
	</if>
	
	</script>
<script type="text/javascript">

$(function(){
	$("#ulGoodsList li a.go_cart").click(function(){ 
		var sw = $("#ulGoodsList li a.go_cart").index(this);
		var src = $("#ulGoodsList li .pic a img").eq(sw).attr('src');				
		var $shadow = $('<img id="cart_dh" style="display:none; border:1px solid #aaa; z-index:99999;" width="200" height="200" src="'+src+'" />').prependTo("body");  			
		var $img = $("#ulGoodsList li .pic").eq(sw);
		$shadow.css({ 
			'width' : 200, 
			'height': 200, 
			'position' : 'absolute',      
			"left":$img.offset().left+16, 
			"top":$img.offset().top+9,
			'opacity' : 1    
		}).show();
		var $cart = $("#btnMyCart");
		$shadow.animate({   
			width: 1, 
			height: 1, 
			top: $cart.offset().top,    
			left: $cart.offset().left, 
			opacity: 0
		},500,function(){
			Cartcookie(sw,false);
		});	
		
	});
	/*
	$("#ulGoodsList li a.go_Shopping").click(function(){	
		var sw = $("#ulGoodsList li a.go_Shopping").index(this);

		Cartcookie(sw,true); 
	});	*/
});
//存到COOKIE
function Cartcookie(sw,cook){
	var shopid = $(".Curbor_id").eq(sw).text(),
		shenyu = $(".Curbor_yunjiage").eq(sw).text(),
		money = $(".Curbor_shenyu").eq(sw).text();
	var Cartlist = $.cookie('Cartlist');
	if(!Cartlist){
		var info = {};
	}else{
		var info = $.evalJSON(Cartlist);
	}
	if(!info[shopid]){
		var CartTotal=$("#sCartTotal").text();
			$("#sCartTotal").text(parseInt(CartTotal)+1);
			$("#btnMyCart em").text(parseInt(CartTotal)+1);
	}	
	info[shopid]={};
	info[shopid]['num']=1;
	info[shopid]['shenyu']=shenyu;
	info[shopid]['money']=money;
	info['MoenyCount']='0.00';
	$.cookie('Cartlist',$.toJSON(info),{expires:30,path:'/'});
	if(cook){
		window.location.href="http://lyz.***.com/?/member/cart/cartlist";
	}
}  

</script>

<style>.yFootSupport_in dd a{height:30px;line-height:30px;}</style>
<script type="text/javascript">
  function current(){ 
  var d=new Date(),str=''; 
  str +=d.getMonth()+1+'月'; //获取当前月份（0——11） 
  str +=d.getDate()+'日&nbsp;&nbsp;'; 
  str +=d.getHours()+':'; 
  str +=d.getMinutes()+':'; 
  str +=d.getSeconds()+''; 
  return str; } 
  setInterval(function(){$("#nowTime").html(current)},1000); 
</script>
  <style>
  .header-right{float: right;margin-right: 5px;margin-top: 20px;}
  .header-right a{
      display: block;
      width: 130px;text-align: center;
      height: 42px;line-height: 42px;background:#ff4a00;border-radius: 2px;color: #fff;font-size: 20px;
  }
  </style>

	


	
	
	<script type="text/javascript">
				
				
				
$(document).ready(function(){
	//加入清单
	$('.oneget').click(function(){
		var _this = $(this);
		var goods_id = parseInt(_this.attr('goods_id'));
		$.ajax({
			type : 'POST',
			url : '/index.php?m=Go&c=Ajax&a=addShopCart&gid='+goods_id+'&num='+1,
			success : function(res){
				var res = $.parseJSON(res);
				if (res['code'] == 0) {
					if(res['num'] > 0){
				$('.m-other span').text(res['num']);
					}
				}
			}
		});
	});  
	//立即夺宝
	$('.nowget').click(function(){
	    var _this = $(this);
	    var goods_id = parseInt(_this.attr('goods_id'));
	    $.ajax({
	        type : 'POST',
	        url : '/index.php?m=Go&c=Ajax&a=addShopCart&gid='+goods_id+'&num='+1,
	        success : function(res){
	            var res = $.parseJSON(res);
	            if (res['code'] == 0) {
	                if(res['num'] > 0){
	                    location.href = "{:U('Home/Yungo/index',array('to'=>1))}"
	                }
	            }
	        }
	    });
	});
})
</script>

<script>
/*
	//组团夺宝基金
	$.ajax({
		url:"http://lyz.***.com/?/api/fund/get",
		success:function(msg){
		var str='<i class="rmbf">￥</i>'+msg;
			$("#spanFundTotal").html(str);
		}
	});

function getCount(){
		$.get("http://lyz.***.com/?/member/cart/getnumber/"+ new Date().getTime(),function(data){
			$("#sCartTotal").text(data);											
			$("#btnMyCart em").text(data);
			$('.head_cart span').text(data);								
		});
}
getCount();
setInterval(function(){
	getCount();
},2000);
*/
</script>
</block>